package com.luomo.java.juc.producerconsumer;

/**
 * @author LiuMei
 * @date 2021-04-12.
 */
public class LockDemo {

    public static void main(String[] args) {

        ShareData data = new LockShareData();

        new Thread(() -> {
            for (int i = 0; i < 5; i++) {
                data.add();
            }
        }, "a").start();

        new Thread(() -> {
            for (int i = 0; i < 5; i++) {
                data.sub();
            }
        }, "b").start();

    }

}

